<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
          const obj = {
        uname: '只因',
        age: 2.5,
        hobbit: ['sing', 'dance', 'rap', 'basketball'],
        fans: {
          uname: 'ikun',
          age: 9999,
          hobbit: ['smoke', 'drink', 'makeHairStyle'],
        },
      }
    console.log(obj.uname);
    const obj1={}
    const deepClone = function(newArr,oldArr){
      for(let i in oldArr){
        if(oldArr[i] instanceof Array){
          newArr[i]=[]
          deepClone(newArr[i],oldArr[i])
        }else if(oldArr[i] instanceof Object){
          newArr[i]={}
          deepClone(newArr[i],oldArr[i])
        }else{
          newArr[i]=oldArr[i]
        }      
      }
    }
    deepClone(obj1,obj)
    console.log(obj1);
    </script>
</body>
</html>